//
//  AXMyPaymoneyVC.m
//  AnXin100
//
//  Created by 天质弘耕 on 2018/11/9.
//  Copyright © 2018 tzhg. All rights reserved.
//
//缴纳费用
#import "AXMyPaymoneyVC.h"
#import "XFStepView.h"
#import "UIViewController+HBD.h"
#import "AXMyEnterSucceedVC.h"


@interface AXMyPaymoneyVC ()

@property (nonatomic , strong) XFStepView *stepView2;

@end

@implementation AXMyPaymoneyVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor whiteColor];
    // Do any additional setup after loading the view.
    [self setupNavigationItems];
    [self creatView];
    
}

- (void)creatView {
    
    UIView *topView = [[UIView alloc]initWithFrame:CGRectMake(0, Hn+20, SCREEN_WIDTH, 300)];
    topView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:topView];
    
    
    _stepView2 = [[XFStepView alloc] initWithFrame:CGRectMake(20, 0, SCREEN_WIDTH - 40, 100) Titles:@[@"提交资料", @"缴纳费用", @"入驻成功"]];
    self.hbd_barTintColor = [UIColor whiteColor];
    self.hbd_barShadowHidden = YES;
    [topView  addSubview:_stepView2];
    
    UILabel *titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(50, CGRectGetMaxY(self.stepView2.frame)+50, SCREEN_WIDTH-100, 30)];
    titleLabel.textAlignment = NSTextAlignmentCenter;
    titleLabel.text = @"安心100平台商家入驻服务保证金";
    titleLabel.font = FONT_FOURTEEN;
    titleLabel.textColor = COLOR_DIV;
    [topView addSubview:titleLabel];
    [topView addSubview:titleLabel];
    
    UILabel *payLable = [[UILabel alloc]initWithFrame:CGRectMake(10, CGRectGetMaxY(titleLabel.frame)+20, SCREEN_WIDTH-20, 30)];
    payLable.textAlignment = NSTextAlignmentCenter;
    payLable.font = FONT_FOURTEEN;
    
    /** 富文本 */
    NSMutableAttributedString  *timeString = [[  NSMutableAttributedString  alloc]init];
    NSAttributedString *timeStr = [[ NSAttributedString alloc]initWithString:@"应付金额: " attributes:@{NSFontAttributeName:FONT_FOURTEEN,NSForegroundColorAttributeName:COLOR_DIV}];
    [timeString appendAttributedString:timeStr];
    
    NSAttributedString *str2 = [[ NSAttributedString alloc]initWithString:@"2000元" attributes:@{NSFontAttributeName:FONT_FOURTEEN,NSForegroundColorAttributeName:COLOR_ORG}];
    [timeString appendAttributedString:str2];
   payLable.attributedText = timeString;//把字符串加到prepareLessonLabel上
    [topView addSubview:payLable];
    
    UIView *midView = [[UIView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(topView.frame)+10, SCREEN_WIDTH, 300)];
    midView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:midView];
    
    UILabel *pay = [[UILabel alloc]initWithFrame:CGRectMake(10, 10, SCREEN_WIDTH, 30)];
    pay.text = @"选中支付方式";
    pay.textAlignment = NSTextAlignmentCenter;
    pay.font = FONT_FOURTEEN;
    pay.textColor = COLOR_DIV;
    [midView addSubview:pay];
    
    
    UIView *wxView = [[UIView alloc]initWithFrame:CGRectMake(50, CGRectGetMaxY(pay.frame)+20, (SCREEN_WIDTH-90)/2, 40)];
    wxView.borderWidth = 1;
    wxView.cornerRadius= 5;
    wxView.borderColor = COLOR_GREEN;
    [midView addSubview:wxView];
    
    UIImageView *wx = [[UIImageView alloc]initWithFrame:CGRectMake(20, 5, 30, 30)];
    wx.image = [UIImage imageNamed:@"zfwx"];
    [wxView addSubview:wx];
    
    UILabel *wxLabel = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(wx.frame)+10, 5, 70, 30)];
    wxLabel.text = @"微信支付";
    wxLabel.font = FONT_FOURTEEN;
    wxLabel.textColor = COLOR_DIV;
    [wxView addSubview:wxLabel];
    
    UIView *zfbView = [[UIView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(wxView.frame)+20, CGRectGetMaxY(pay.frame)+20, (SCREEN_WIDTH-90)/2, 40)];
    [midView addSubview:zfbView];
    
    UIImageView *zfb = [[UIImageView alloc]initWithFrame:CGRectMake(20, 5, 30, 30)];
    zfb.image = [UIImage imageNamed:@"zfzfb"];
    [zfbView addSubview:zfb];
    
    UILabel *zfbLabel = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(zfb.frame)+10, 5, 100, 30)];
    zfbLabel.text = @"支付宝支付";
    zfbLabel.textColor = COLOR_DIV;
    zfbLabel.font = FONT_FOURTEEN;
    [zfbView addSubview:zfbLabel];
    
    
    UIButton *payBtn = [[UIButton alloc]init];
    [payBtn addTarget:self action:@selector(goPay:) forControlEvents:UIControlEventTouchUpInside];
    payBtn.backgroundColor = COLOR_GREEN;
    [payBtn setTitle:@"去支付" forState:UIControlStateNormal];
    [payBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    payBtn.cornerRadius = 5;
    payBtn.titleLabel.font = FONT_FOURTEEN;
    [midView addSubview:payBtn];
    
    
    payBtn.sd_layout
    .centerXEqualToView(midView)
    .topSpaceToView(wxView, 50)
    .widthIs(100)
    .heightIs(40);
    
    
    
    
    
    
    
    
    
}


#pragma mark - action

- (void)goPay:(UIButton *)btn {
    
    AXMyEnterSucceedVC *vc = [[AXMyEnterSucceedVC alloc]init];
    [self.navigationController pushViewController:vc animated:YES];
    
}



- (void)setupNavigationItems {
    
    /** 导航条左边的按钮 */
    //返回按钮
    UIButton *kfBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [kfBtn setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal];
    kfBtn.frame = CGRectMake(0, 0, 30, 30);
    [kfBtn addTarget:self action:@selector(backAction:) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem *leftItem = [[UIBarButtonItem alloc]initWithCustomView:kfBtn];
    self.navigationItem.leftBarButtonItem = leftItem;
    /** 搜索 */
    UILabel *titleLabel = [[UILabel alloc]init];
    titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, 30)];
    titleLabel.text = @"审核进度";
    titleLabel.textAlignment = NSTextAlignmentCenter;
    titleLabel.font = FONT_EIGHTEEN;
    titleLabel.textColor = [UIColor colorWithHex:0x29b566];
    self.navigationItem.titleView = titleLabel;
    
    
}

#pragma mark - Action

- (void)backAction:(UIBarButtonItem *)item {
    [self.navigationController popViewControllerAnimated:YES];
}




@end
